<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
    input{ border: 1px solid #a1c0dc;}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>
<div class="t_bar">基本情况</div>
<table   width="100%" border="0" cellpadding="0" cellspacing="1" id="infoForm_01">
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <col style="width: 20%"/>
    <col style="width: 30%"/>

    <tr style="background: #fbfbfb;">
        <td align="right"><span class="color_red">*</span>众创空间名称：</td>
        <td colspan="3">
            <input type='text' name='proposal/zh_title' id='zh_title' style="width: 87.5%" class="input_css required" maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="众创空间名称">
        </td>
    </tr>

    <tr style="background: #f1f1f1;">
        <td align="right">运营主体名称（盖章）：</td>
        <td colspan="3">
            <%--<input type='text' name='proposal/operation_subject_name' style="width: 87.5%" class="input_css required" maxlength="100" value='<x:out select="$xmlData/data/proposal/operation_subject_name"/>' label="运营主体名称">--%>
            <span name="organizations/organization/org_name"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/org_name" /></span>
        </td>
    </tr>

    <tr style="background: #fbfbfb;">
        <td align="right"><span class="color_red">*</span>注册地址：</td>
        <td colspan="3" align="left">
            <input type='text' name='proposal/register_address' style="width: 87.5%" class="input_css required" maxlength="100" value='<x:out select="$xmlData/data/proposal/register_address"/>' label="注册地址">
        </td>
    </tr>



    <tr style="background: #f1f1f1;">
        <td align="right"><span class="color_red">*</span>运营主体性质：</td>
        <td colspan="3" align="left">
            <c:set var="operation_subject_natures"><x:out select="$xmlData/data/proposal/operation_subject_nature_value" /></c:set>
            <cpt:checkbox key="operation_main_natures" style="float:left;width:15px;" name="operation_subject_nature" width="70px" repeatColumn="4" value="${operation_subject_natures }"  tagType="radio" ></cpt:checkbox>
            <input type="hidden" id="operation_subject_nature_value" name="proposal/operation_subject_nature_value" class="required" value="${operation_subject_natures }" label="运营主体性质">
            <input type="hidden" id="operation_subject_nature_name" name="proposal/operation_subject_nature_name" value="<x:out select="$xmlData/data/proposal/operation_subject_nature_name" />">
            <!-- 其他的值 -->
            <input type="hidden" id="operation_subject_nature_other" name="proposal/operation_subject_nature_other" label="运营主体性质-->其他" value="<x:out select="$xmlData/data/proposal/operation_subject_nature_other" />"/>
            <input type="hidden" id="enterprise_type_other" name="proposal/enterprise_type_other" label="运营主体性质-->企业-->国有或民营" value="<x:out select="$xmlData/data/proposal/enterprise_type_other" />"/>
        </td>
    </tr>

    <tr style="background: #fbfbfb;">
        <td align="right"><span class="color_red">*</span>机构类型：</td>
        <td colspan="3" align="left">
            <c:set var="institutional_types"><x:out select="$xmlData/data/proposal/institutional_type_value" /></c:set>
            <cpt:checkbox key="institutional_types" name="institutional_type"  width="70px" repeatColumn="2" value="${institutional_types }"  tagType="radio" ></cpt:checkbox>
            <input type="hidden" id="institutional_type_value" name="proposal/institutional_type_value" class="required" value="${institutional_types }" label="机构类型">
            <input type="hidden" id="institutional_type_name" name="proposal/institutional_type_name" value="<x:out select="$xmlData/data/proposal/institutional_type_name" />">
            <!-- 领域的值 -->
            <input type="hidden" label="机构类型-->专业性-->领域" name="proposal/institutional_type_other" id="institutional_type_other" value="<x:out select="$xmlData/data/proposal/institutional_type_other" />"/>
        </td>
    </tr>

    <tr style="background: #f1f1f1;">
        <td align="right"><span class="color_red">*</span>归口管理部门：</td>
        <td>
            <c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  label="归口管理部门"
                      id="recomend_org" onlyChooseLeaf="false"  showPattern="all" shieldPattern="0" topCheckbox="true" onClick="initTreeValueExt" />
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
            <input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
        </td>
        <td align="right" ><span class="color_red">*</span>申报日期：</td>
        <td><c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
            <cpt:date id="apply_date_curr"  name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
        </td>
    </tr>

    <tr style="background: #fbfbfb;">
        <td align="right">注册时间：</td>
        <td>
           <%-- <c:set var="registe_date"><x:out select="$xmlData/data/organizations/organization/registe_date" /></c:set>
            <input type="text" class="input_css gray" readonly="readonly" value="${registe_date }"/>
            <input type="hidden" name="proposal/registe_date" value="${registe_date }">--%>
               <input type="text" class="input_css" style="border: 1px solid #a8a8a8;background-color: #e6e6e6;" disabled="disabled" name="organizations/organization/registe_date" value="<x:out select="$xmlData/data/organizations/organization/registe_date" />">
        </td>
        <td align="right"><span class="color_red">*</span>开始运营时间：</td>
        <td>
            <c:set var="start_operation_time"><x:out select="$xmlData/data/proposal/start_operation_time" /></c:set>
            <cpt:date name="proposal/start_operation_time" value="${start_operation_time}" id="start_operation_time" className="required date" label="开始运营时间"></cpt:date>
        </td>
    </tr>



    <tr style="background: #f1f1f1;">
        <td align="right"><span class="color_red">*</span>联系人：</td>
        <td>
            <input  type="text" label="联系人" name="proposal/person_contact_name" class="input_css required" maxlength="50" value="<x:out select="$xmlData/data/proposal/person_contact_name" />">
            <span name="proposal/contact_email" style="display: none;">
                    <x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_email"/>
                </span>
            <span name="proposal/contact_tel" style="display: none;">
                    <x:out select="$xmlData/data/organization_persons/organization_person[@psn_type='lianxiren']/contact_tel"/>
                </span>
        </td>
        <td align="right"><span class="color_red">*</span>联系电话：</td>
        <td>
            <input type="text" label="联系电话" name="proposal/person_contact_mobile" class="input_css required maxlength:20"  value="<x:out select="$xmlData/data/proposal/person_contact_mobile" />">
        </td>
    </tr>
</table>

<div class="t_bar"><span class="color_red">*</span>场地面积</div>
<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="infoForm_02">
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <tr>
        <td align="right">众创空间总面积（平方米）：</td>
        <td>
            <input type="text" label="众创空间总面积" class="required" name="proposal/maker_space_area" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,2,2)" value='<x:out select="$xmlData/data/proposal/maker_space_area"/>' >
        </td>
        <td align="right">常驻团队和企业使用面积<br/>（平方米）：</td>
        <td>
            <input type="text" label="常驻团队和企业使用面积" class="required" name="proposal/usable_area" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,2,2)" value='<x:out select="$xmlData/data/proposal/usable_area"/>' >
        </td>
    </tr>
</table>

<div class="t_bar"><span class="color_red">*</span>服务队伍</div>
<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="infoForm_03">
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <tr>
        <td align="right">众创空间服务人员数量（个）：</td>
        <td>
            <input type="text" label="众创空间服务人员数量" class="required" name="proposal/service_personal" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,0,0)" value='<x:out select="$xmlData/data/proposal/service_personal" />' >
        </td>
        <td align="right">创业导师队伍（人）：</td>
        <td>
            <input type="text" label="创业导师队伍" class="required" name="proposal/enterprise_mentor" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,0,0)" value='<x:out select="$xmlData/data/proposal/enterprise_mentor"/>' >
        </td>
    </tr>
</table>

<div class="t_bar"><span class="color_red">*</span>孵化团队和企业</div>
<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="infoForm_04">
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <tr>
        <td align="right">常驻创业团队的数量（个）：</td>
        <td>
            <input type="text" label="常驻创业团队的数量" class="required" name="proposal/entrepreneur_teams" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,0,0)" value='<x:out select="$xmlData/data/proposal/entrepreneur_teams"/>' >
        </td>
        <td align="right">常驻初创企业的数量（个）：</td>
        <td>
            <input type="text" label="常驻初创企业的数量" class="required" name="proposal/startup_number" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,0,0)" value='<x:out select="$xmlData/data/proposal/startup_number"/>' >
        </td>
    </tr>
    <tr>
        <td align="right">当年新注册企业数量（个）：</td>
        <td>
            <input type="text" label="当年新注册企业数量" class="required" name="proposal/new_register_number" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,0,0)" value='<x:out select="$xmlData/data/proposal/new_register_number" />' >
        </td>
        <td align="right">当年获得投融资的创业团队和初创企业的数量（个）：</td>
        <td>
            <input type="text" label="当年获得投融资的创业团队和初创企业的数量" class="required" name="proposal/financing_numbers" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,0,0)" value='<x:out select="$xmlData/data/proposal/financing_numbers"/>'>
        </td>
    </tr>
    <tr>
        <td align="right">创业团队和初创企业当年获得投融资总额（万元）：</td>
        <td>
            <input type="text" label="创业团队和初创企业当年获得投融资总额" class="required" name="proposal/financing_sums" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,2,2)" value='<x:out select="$xmlData/data/proposal/financing_sums"/>' >
        </td>
        <td align="right">常驻创业团队和常驻初创企业拥有有效知识产权数量（个）：</td>
        <td>
            <input type="text" label="常驻创业团队和常驻初创企业拥有有效知识产权数量" class="required" name="proposal/intellectual_property_number" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,0,0)" value='<x:out select="$xmlData/data/proposal/intellectual_property_number"/>' >
        </td>
    </tr>
</table>

<div class="t_bar"><span class="color_red">*</span>其它</div>
<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="infoForm_05">
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <col style="width: 20%"/>
    <col style="width: 30%"/>
    <tr>
        <td align="right">当年举办创新创业活动<br/>（场次）：</td>
        <td>
            <input type="text" label="当年举办创新创业活动" class="required" name="proposal/entrepreneurship_activities" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,0,0)" value='<x:out select="$xmlData/data/proposal/entrepreneurship_activities" />' >
        </td>
        <td align="right">创业团队人员数量和初创企业吸纳就业人数之和（人）：</td>
        <td>
            <input type="text" label="创业团队人员数量和初创企业吸纳就业人数之和" class="required" name="proposal/employment_persons" style="text-align: right"
                   onfocus="InitInput.setNumber(this,7,0,0)" value='<x:out select="$xmlData/data/proposal/employment_persons" />' >
        </td>
    </tr>
</table>

<br>

<script type="text/javascript">
    //文本框只显示下边框
    $(".survey").css({
        "border":"none",
        "border-bottom":"1px solid black",
        "text-align":"right",
        "width":30
    });

    //创建节点
    var operation_subject4 = '<span><input type="text" label="其他" id="radio4" style="height: 17px;width: 145px;border: none;border-bottom: 1px solid gray;background-color: #f1f1f1;" maxlength="50" class="required" value="" onblur="setValByRadio4();" /></span>';
    var institutional_type2 = '<span>&nbsp;领域（请注明）：<input type="text" label="领域" id="radio2" style="height: 17px;border: none;border-bottom: 1px solid gray;background-color: #fbfbfb;" maxlength="50" class="required" value="" onblur="setValByRadio2();"/></span>';
    var enterprise_type ='<span id="enterprise_type">' +
        '（<input type="radio" label="国有" id="stateEnterprise"  value="4" name="enterprise_type"  onblur="setValByRadio5()">国有' +
        '  <input type="radio" label="民营" id="privateEnterprise"  value="5" name="enterprise_type"  onblur="setValByRadio6()">民营）'+
        '</span>';

    //初始化radio  operation_subject_nature_other
    if($('input:radio[name="operation_subject_nature"]:checked').val()==3){
        $("input[name='operation_subject_nature']").parent().parent().parent().find('td').last('label').append(operation_subject4);
        var radio4_hidden = $("#operation_subject_nature_other").val();
        $("#radio4").val(radio4_hidden);
        $("#operation_subject_nature_other").addClass("required");
    }

    //初始化radio(企业) enterprise_type
    if($('input:radio[name="operation_subject_nature"]:checked').val()==2){
        $("input[name='operation_subject_nature']").parent().parent().parent().find('td').has("label").eq(1).append(enterprise_type);
        var enterpriseTypeHidden =$("#enterprise_type_other").val();
        //当获取值隐藏值为4时，选中国有企业状态
        if(enterpriseTypeHidden==4){
            $("#stateEnterprise").attr('checked','true');
        }
        //当获取值隐藏值为5时，选中民营企业状态
        if(enterpriseTypeHidden==5){
            $("#privateEnterprise").attr('checked','true');
        }
        $("#enterprise_type_other").addClass("required");

    }

    //初始化radio  institutional_type_other
    if($('input:radio[name="institutional_type"]:checked').val()==2){
        $("input[name='institutional_type']").parent().parent().parent().find('td').last('label').append(institutional_type2);
        var radio2_hidden = $("#institutional_type_other").val();
        $("#radio2").val(radio2_hidden);
        $("#institutional_type_other").addClass("required");
    }

    //对radio须注明选项的值赋值给隐藏域 institutional_type_other
    function setValByRadio2(){
        var radio2 = $("#radio2").val();
        $("#institutional_type_other").val(radio2);
    }

    //对radio须注明选项的值赋值给隐藏域 operation_subject_nature_other
    function setValByRadio4(){
        var radio4 = $("#radio4").val();
        $("#operation_subject_nature_other").val(radio4);
    }
    //对隐藏域 enterprise_type_other 进行赋值
    function setValByRadio5(){
        var radio5 = $("#stateEnterprise").val();
        $("#enterprise_type_other").val(radio5);
    }
    //对隐藏域 enterprise_type_other 进行赋值
    function setValByRadio6(){
        var radio6 = $("#privateEnterprise").val();
        $("#enterprise_type_other").val(radio6);
    }
    //当运营主体性质被其他选中，则显示输入框，被企业选中时，则显示单选框
    $("input[name='operation_subject_nature']").click(function(){
        var val=$('input:radio[name="operation_subject_nature"]:checked').val();
        //选中其他时的判断
        if(val==3){
            $(this).parent().parent().parent().find('span').remove();
            if($(this).parent().parent().parent().find('span').length<=0){
                $(this).parent().parent().parent().find('td').last('label').append(operation_subject4);
                $("#operation_subject_nature_other").addClass("required");
            }
        } else{
            $("#operation_subject_nature_other").removeClass("required");
            $("#operation_subject_nature_other").val("");
            $(this).parent().parent().parent().find('span').remove();
        }
        //选中企业时的状态赋值
        if(val==2){
            $(this).parent().parent().parent().find('span').remove();
            if($(this).parent().parent().parent().find('span').length<=0){
                $(this).parent().parent().parent().find('td').has("label").eq(1).append(enterprise_type);
                $("#enterprise_type_other").addClass("required");
            }
        }else {
            $("#enterprise_type_other").removeClass("required");
            $("#enterprise_type_other").val("");
            $(this).parent().parent().parent().find('span[id="institutional_type"]').remove();
        }
    });




    //当机构类型专业性被选中，则显示输入框
    $("input[name='institutional_type']").click(function(){
        var val=$('input:radio[name="institutional_type"]:checked').val();
        if(val==2){
            if($(this).parent().parent().parent().find('span').length<=0){
                $(this).parent().parent().parent().find('td').last('label').append(institutional_type2);
                $("#institutional_type_other").addClass("required");
            }
        } else{
            $("#institutional_type_other").removeClass("required");
            $("#institutional_type_other").val("");
            $(this).parent().parent().parent().find('span').remove();
        }
    });

    function initTreeValueExt(treeId, treeNode) {
        if ((treeNode && treeNode.isParent)) {
            scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
            $("#" + treeId).val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
            $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
            return false;
        }
        var str = treeNode.name;
        var obj = treeNode.parentNode;
        while (obj != null) {
            str = obj.name + "-" + str;
            obj = obj.parentNode;
        }

        $("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
        $("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
    }
</script>	